package com.hxzy.shop.fallback.auth;

import com.github.pagehelper.PageInfo;
import com.hxzy.shop.common.dto.auth.req.*;
import com.hxzy.shop.common.dto.auth.resp.*;
import com.hxzy.shop.dto.auth.req.LoadUserReq;
import com.hxzy.shop.dto.auth.resp.LoadUserResp;
import com.hxzy.shop.dto.auth.resp.Oauth2TokenDto;
import com.hxzy.shop.feign.auth.AuthFeign;
import com.hxzy.shop.vo.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * 功能描述: Auth远程服务，服务降级
 *
 * @author tonneyyy
 */
@Component
public class AuthFallback implements AuthFeign {


    /**
     * 登录授权 服务降级
     * @param parameters
     * @param merchantId
     * @return
     */
    @Override
    public Result<Oauth2TokenDto> postAccessToken(Map<String, String> parameters, String merchantId) {
        return Result.demotion();
    }

    @Override
    public Result<LoadUserResp> loadUser(LoadUserReq req) {
        return  Result.demotion();
    }

    @Override
    public Map<String, Object> getKey() {
        return null;
    }

    @Override
    public Result<PageInfo<RoleListResp>> roleList(RoleListReq req) {
        return Result.demotion();
    }

//    @Override
//    public Result<PageInfo<RoleListResp>> roleList(Integer pageNum, Integer pageSize, String roleName, Boolean state) {
//        return Result.demotion();
//    }

    @Override
    public Result<RoleDetailResp> roleDetail(Long roleId) {
        return  Result.demotion();
    }

    @Override
    public Result<Object> editRole(EditRoleReq req) {
        return  Result.demotion();
    }

    @Override
    public Result<Object> addRole(AddRoleReq req) {
        return  Result.demotion();
    }

    @Override
    public Result<Object> changeRoleState(ChangeRoleStateReq req) {
        return  Result.demotion();
    }

    @Override
    public Result<List<RoleAuthorityTreeResp>> roleAuthorityTree(Long roleId) {
        return  Result.demotion();
    }

    @Override
    public Result<Object> changeRoleAuthority(ChangeRoleAuthorityReq req) {
        return Result.demotion();
    }

    @Override
    public Result<PageInfo<AccountListResp>> accountList(AccountListReq req) {
        return Result.demotion();
    }

    @Override
    public Result<Object> addAccount(AddAccountReq req) {
        return Result.demotion();
    }

    @Override
    public Result<AccountDetailResp> accountDetail(Long accountId) {
        return  Result.demotion();
    }

    @Override
    public Result<Object> editAccount(EditAccountReq req) {
        return Result.demotion();
    }
}
